<?php
/* @var $this FrontendMenuController */
/* @var $model Menu */
/* @var $form CActiveForm */
?>
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'menu-form',
    // Please note: When you enable ajax validation, make sure the corresponding
    // controller action is handling ajax validation correctly.
    // There is a call to performAjaxValidation() commented in generated controller code.
    // See class documentation of CActiveForm for details on this.
    'htmlOptions'=>array('class'=>'form-horizontal'),
    'enableAjaxValidation'=>false,
)); ?>

<?php echo $form->errorSummary($model); ?>

<div class="form-group">
    <label class="col-sm-2 control-label">父分类菜单名称</label>
    <div class="col-sm-10">
        <select name="Menu[parent_id]" id="Menu_parent_id" class="form-control select2-choice">
            <option value="0">==请选择==</option>
            <?php foreach((array)Menu::getMenuTree(0, Menu::getMenus()) as $menu):?>
                <option value="<?php echo $menu['id']?>" <?php if ($menu['id']==$model->parent_id){echo 'selected';}?>><?=$menu['str_repeat']?>├ <?=$menu['name']?></option>
            <?php endforeach;?>
        </select>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">名称</label>
    <div class="col-sm-10">
        <?php echo $form->textField($model,'name',array('size'=>11,'maxlength'=>11,'class'=>'form-control')); ?>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">绝对地址</label>
    <div class="col-sm-10">
        <?php echo $form ->radioButtonList( $model , 'is_absolute_url' ,array('1'=>'是' , '0'=>'否' ), array('separator'=>'&nbsp;&nbsp;', 'class'=>''));?>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">地址</label>
    <div class="col-sm-10">
        <?php echo $form->textField($model,'url',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">排序</label>
    <div class="col-sm-10">
        <?php echo $form->textField($model,'sort',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">新窗口打开</label>
    <div class="col-sm-10">
        <?php echo $form ->radioButtonList( $model , 'target' ,array('_blank'=>'是' , '_self'=>'否' ), array('separator'=>'&nbsp;&nbsp;', 'class'=>''));?>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">是否显示</label>
    <div class="col-sm-10">
        <?php echo $form ->radioButtonList( $model , 'is_display' ,array('1'=>'是' , '0'=>'否' ), array('separator'=>'&nbsp;&nbsp;', 'class'=>''));?>
    </div>
</div>
    <div class="hr hr-18 dotted"></div>
    <div class="clearfix">
        <div class="col-md-offset-2 col-md-10">
            <button class="btn btn-white btn-info btn-round" type="submit"><i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>保存</button>
            &nbsp;
            <button class="btn btn-white btn-default btn-round" type="reset"><i class="ace-icon fa fa-times red2"></i>取消</button>
        </div>
    </div>
<?php $this->endWidget(); ?>